use ratatui::{
    backend::Backend,
    layout::{Layout, Constraint, Direction},
    widgets::{Block, Borders, Paragraph},
    Terminal,
};
use std::io;

pub fn draw_main_menu<B: Backend>(terminal: &mut Terminal<B>) -> Result<(), io::Error> {
    terminal.draw(|f| {
        let chunks = Layout::default()
            .direction(Direction::Vertical)
            .margin(5)
            .constraints([
                Constraint::Length(3),
                Constraint::Length(1),
                Constraint::Length(1),
                Constraint::Length(1),
            ])
            .split(f.area());

        let block = Block::default().title("🧩 Gitee TUI PR").borders(Borders::ALL);
        let p1 = Paragraph::new("[1] 创建 Pull Request");
        let p2 = Paragraph::new("[2] 评论已有 PR");
        let p3 = Paragraph::new("[q] 退出");

        f.render_widget(p1, chunks[1]);
        f.render_widget(p2, chunks[2]);
        f.render_widget(p3, chunks[3]);

    })?;

    Ok(())
}
